package com.wjmj.balloon.debugger.actions;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.actions.ActionGroup;

import balloondebugger.Activator;

public class DebugActionGroup extends ActionGroup {

	private Action resume_coAction;
	private Action rem_all_coAction;
	private Action suspend_coAction;
	private Action terminate_coAction;
	private Action drop_to_frameAction;
	private Action stepinto_coAction;
	private Action stepover_coAction;
	private Action stepreturn_coAction;
	private Action stepbystep_coAction;

	@Override
	public void fillActionBars(IActionBars actionBars) {
		if (actionBars == null)
			return;

		makeActions();

		IToolBarManager toolBarManager = actionBars.getToolBarManager();
		toolBarManager.add(rem_all_coAction);
		toolBarManager.add(resume_coAction);
		toolBarManager.add(suspend_coAction);
		toolBarManager.add(terminate_coAction);
		toolBarManager.add(new Separator());
		toolBarManager.add(stepinto_coAction);
		toolBarManager.add(stepover_coAction);
		toolBarManager.add(stepreturn_coAction);
		toolBarManager.add(drop_to_frameAction);
		toolBarManager.add(new Separator());
		toolBarManager.add(stepbystep_coAction);

	}

	private void makeActions() {

		// rem_all_co
		rem_all_coAction = new Action() {
			public void run() {
				// TODO do rem_all_co
			}
		};
		rem_all_coAction.setToolTipText("Remove All Terminated Launches");
		rem_all_coAction.setImageDescriptor(Activator
				.getImageDescriptor("icons/debug/rem_all_co.gif"));

		// Resume
		resume_coAction = new Action() {
			public void run() {
				// TODO do resume_co
			}
		};
		resume_coAction.setToolTipText("Resume");
		resume_coAction.setImageDescriptor(Activator
				.getImageDescriptor("icons/debug/resume_co.gif"));

		// suspend
		suspend_coAction = new Action() {
			public void run() {
				// TODO do suspend_co
			}
		};
		suspend_coAction.setToolTipText("Suspend");
		suspend_coAction.setImageDescriptor(Activator
				.getImageDescriptor("icons/debug/suspend_co.gif"));

		// terminate
		terminate_coAction = new Action() {
			public void run() {
				// TODO do terminate_co
			}
		};
		terminate_coAction.setToolTipText("Terminate");
		terminate_coAction.setImageDescriptor(Activator
				.getImageDescriptor("icons/debug/terminate_co.gif"));

		// drop_to_frame
		drop_to_frameAction = new Action() {
			public void run() {
				// TODO do drop_to_frame
			}
		};
		drop_to_frameAction.setToolTipText("Drop To Frame");
		drop_to_frameAction.setImageDescriptor(Activator
				.getImageDescriptor("icons/debug/drop_to_frame.gif"));

		// stepinto_co
		stepinto_coAction = new Action() {
			public void run() {
				// TODO do stepinto_co
			}
		};
		stepinto_coAction.setToolTipText("Step Into");
		stepinto_coAction.setImageDescriptor(Activator
				.getImageDescriptor("icons/debug/stepinto_co.gif"));

		// stepover_co
		stepover_coAction = new Action() {
			public void run() {
				// TODO do stepover_co
			}
		};
		stepover_coAction.setToolTipText("Step Over");
		stepover_coAction.setImageDescriptor(Activator
				.getImageDescriptor("icons/debug/stepover_co.gif"));

		// stepreturn_co
		stepreturn_coAction = new Action() {
			public void run() {
				// TODO do stepreturn_co
			}
		};
		stepreturn_coAction.setToolTipText("Step Return");
		stepreturn_coAction.setImageDescriptor(Activator
				.getImageDescriptor("icons/debug/stepreturn_co.gif"));

		// stepbystep_co
		stepbystep_coAction = new Action() {
			public void run() {
				// TODO do stepbystep_co
			}
		};
		stepbystep_coAction.setToolTipText("Step By Step");
		stepbystep_coAction.setImageDescriptor(Activator
				.getImageDescriptor("icons/debug/stepbystep_co.gif"));
	}

}
